extends "../../../azurlane_ctrl/Boss.gd"

var baseId = ""
func _extInit():
	._extInit()
	chaName = "「高级塞壬」仲裁者·赫米忒·IX"   #角色的名称
	attInfox.maxHp = 88888
	attInfox.atk = 600
	attInfox.mgiAtk = 600
	attInfox.def = 300
	attInfox.dod = 100
	attInfox.cd += 0.3
	attInfox.spd += 1
	attInfox.suck += 0.1
	attInfox.cri += 0.2
	attInfox.penL += 0.2
	attInfox.atkRan = 8
	lv = 4            #等级的设置
	ename = "hemite"
	addSkill("受到来自正面的伤害降低80%，正斜面的伤害降低30%，背后的伤害提高50%，斜后方的伤害提高30%", "重点防御")
	addSkill("炮击时对当前目标同列的所有敌人同时造成炮击伤害", "横扫")
	addSkill("造成炮击伤害时，附带5层<灼烧>", "罡风")
	addSkill("每{cd}秒，撕裂当前目标的护甲，使其护甲降低50%，并对周围1格的敌人造成2次炮击", "乱舞", "luanWu", 8)

func _castCdSkill(id):
	._castCdSkill(id)
	if id == "luanWu":
		luanWu()

func luanWu():
	if aiCha.hasBuff("b_hemite") == null:
		castBuff(aiCha, b_hemite.new())
	for i in getCellChas(aiCha.cell, 1, 1):
		normalAtkChara(i)
		if not i.isDeath:
			normalAtkChara(i)

func normalAtkChara(cha):
	for i in range(6):
		var c = Vector2(cha.cell.x, i)
		var cha2 = matCha(c)
		if cha2 != null and cha.team != team:
			.normalAtkChara(cha2)

func _onHurt(atkInfo):
	._onHurt(atkInfo)
	var c = atkInfo.atkCha.cell
	if c.y == cell.y and c.x < cell.x:
		#正前方
		atkInfo.hurtVal *= 0.2
	elif c.y == cell.y and c.x > cell.x:
		#正后方
		atkInfo.hurtVal *= 1.5
	elif c.x < cell.x:
		#正斜面
		atkInfo.hurtVal *= 0.7
	else:
		#反斜面
		atkInfo.hurtVal *= 1.3

func getItems():
	addItem(sys.newItem(itemData.rndGetEquipEx(itemData.EquipType.DEF)))		
	addItem(sys.newItem(itemData.rndGetEquipEx(itemData.EquipType.AD)))	
	addItem(sys.newItem(itemData.rndGetEquipEx(itemData.EquipType.AD)))

	for it in items:
		if it.has_method("upgrade"):
			it.upgrade()
			it.upgraded = true

func _onAtkInfo(atkInfo):
	._onAtkInfo(atkInfo)
	if atkInfo.atkType == sys.AtkType.GUN and atkInfo.atkCha == self:
		castBuff(atkInfo.hitCha, buff.b_zhuoShao.new(5))
	
class b_hemite:
	extends "../../../azurlane_ctrl/AzurBuff.gd"
	func _init():
		attInit()
		id = "b_hemite"	
		att.defL = -0.5